<template>
  <div>
    <!-- 整体框架布局 -->
    <div class="buju">
      <el-container>
        <!-- 外层框架的侧边栏区域 和宽度-->
        <el-aside width="260px">
          <!-- 折叠 -->
          <!-- <el-radio-group v-model="isCollapse" style="margin-bottom: 20px;">
              <el-radio-button :label="false">展开</el-radio-button>
              <el-radio-button :label="true">收起</el-radio-button>
            </el-radio-group>-->
          <!-- 侧边栏菜单框架 -->
          <template>
            <div class="title">
              <i class="el-icon-s-promotion logo"></i>
              <div>共享</div>
            </div>
            <div class="user-img">
              <el-avatar :size="size" :src="circleUrl"></el-avatar>
              <div class="img-text">{{ userName }}您好！ 欢迎登录</div>
            </div>
          </template>
          <el-row class="tac">
            <el-col>
              <!--  active-text-color 选中改变文字颜色 -->
              <!-- background-color 弹性菜单背景颜色 -->
              <!-- :collapse="isCollapse" 折叠菜单 -->
              <el-menu
                :default-active="this.$route.path"
                class="el-menu-vertical-demo"
                @open="handleOpen"
                @close="handleClose"
                background-color="#494B4C"
                color="#F0F2F4"
                active-text-color="#2C8BED。"
                :collapse="isCollapse"
                :unique-opened="true"
                router
              >
                <br />
                <el-submenu index="1">
                  <template slot="title">
                    <i class="el-icon-magic-stick"></i>
                    <span>首页</span>
                  </template>
                  <!-- 二级菜单 -->
                  <el-menu-item-group>
                    <el-menu-item index="/home/Index">首页</el-menu-item>
                  </el-menu-item-group>
                </el-submenu>

                <el-submenu index="2">
                  <template slot="title">
                    <i class="el-icon-notebook-2"></i>
                    <span>用户管理</span>
                  </template>
                  <!-- 二级菜单 -->
                  <el-menu-item-group>
                    <el-menu-item index="/home/UserManage"
                      >基本信息管理</el-menu-item
                    >
                  </el-menu-item-group>
                  <el-menu-item-group>
                    <el-menu-item index="/home/SafetyManage"
                      >安全信息管理</el-menu-item
                    >
                  </el-menu-item-group>
                </el-submenu>
                <el-submenu index="3">
                  <template slot="title">
                    <i class="el-icon-guide"></i>
                    <span>代理管理</span>
                  </template>
                  <!-- 二级菜单 -->
                  <el-menu-item-group>
                    <el-menu-item index="/home/FirstLevel"
                      >一级代理</el-menu-item
                    >
                  </el-menu-item-group>
                  <el-menu-item-group>
                    <el-menu-item index="/home/TwoLevel">二级代理</el-menu-item>
                  </el-menu-item-group>
                  <el-menu-item-group>
                    <el-menu-item index="/home/ThreeLevel"
                      >三级代理</el-menu-item
                    >
                  </el-menu-item-group>
                  <!-- <el-menu-item-group>
                    <el-menu-item index="/home/allocationProportion"
                      >代理分成比例</el-menu-item
                    >
                  </el-menu-item-group> -->
                </el-submenu>
                <el-submenu index="4">
                  <template slot="title">
                    <i class="el-icon-edit-outline"></i>
                    <span>订单管理</span>
                  </template>
                  <!-- 二级菜单 -->
                  <el-menu-item-group>
                    <el-menu-item index="/home/OrderManage"
                      >订单管理</el-menu-item
                    >
                  </el-menu-item-group>
                </el-submenu>

                <el-submenu index="5">
                  <template slot="title">
                    <i class="el-icon-film"></i>
                    <span>洗衣房管理</span>
                  </template>
                  <!-- 二级菜单 -->
                  <el-menu-item-group>
                    <el-menu-item index="/home/WashHouse"
                      >洗衣房管理</el-menu-item
                    >
                    <!-- <el-menu-item index="/home/WashMachine">洗衣机管理</el-menu-item> -->
                  </el-menu-item-group>
                </el-submenu>
                <el-submenu index="6">
                  <template slot="title">
                    <i class="el-icon-coin"></i>
                    <span>充值记录</span>
                  </template>
                  <!-- 二级菜单 -->
                  <el-menu-item-group>
                    <el-menu-item index="/home/RechargeRecord"
                      >充值记录</el-menu-item
                    >
                  </el-menu-item-group>
                </el-submenu>
                <!--数据统计的图标 <i class="el-icon-s-data"></i> -->
                <!-- <el-menu-item index="6">
                  <i class="el-icon-setting"></i>
                  <span slot="title">系统设置</span>
                  </el-menu-item>-->
                <el-submenu index="7">
                  <template slot="title">
                    <i class="el-icon-bank-card"></i>
                    <span>提现管理</span>
                  </template>
                  <!-- 二级菜单 -->
                  <el-menu-item-group>
                    <el-menu-item index="/home/WithdrawManage"
                      >提现管理</el-menu-item
                    >
                  </el-menu-item-group>
                </el-submenu>
                <el-submenu index="8">
                  <template slot="title">
                    <i class="el-icon-set-up"></i>
                    <span>广告管理</span>
                  </template>
                  <!-- 二级菜单 -->
                  <el-menu-item-group>
                    <el-menu-item index="/home/AdvertiseManage"
                      >广告管理</el-menu-item
                    >
                  </el-menu-item-group>
                </el-submenu>
              </el-menu>
            </el-col>
          </el-row>
        </el-aside>

             <el-container>
          <!-- 头部 -->
          <el-header style="height: 54px; line-heigt: 54px" class="toubu">
              <el-breadcrumb separator-class="el-icon-arrow-right" class="el-bread">
               <el-breadcrumb-item :to="{ path: '/home/Index' }"
                     v-if="this.$route.path=='/home/Index'">首页</el-breadcrumb-item
                  > </el-breadcrumb>
             
            <!-- <template> -->
              <div class="top-menu" v-if="this.$route.path!='/home/Index'">
                <el-breadcrumb separator-class="el-icon-arrow-right">
                  <el-breadcrumb-item :to="{ path: '/home/Index' }"
                    >首页</el-breadcrumb-item
                  >
                  <el-breadcrumb-item>{{this.$route.name}}</el-breadcrumb-item>
                </el-breadcrumb>
              </div>
        
              <el-row>
                  <el-button ref="btnn" type="text" class="btnn" @click="btnn"
                 >退出登录</el-button>
              </el-row>
            <!-- </template> -->
          </el-header>
          <!-- 头部导航 -->

          <el-main>
            <router-view></router-view>
          </el-main>
        </el-container>
      </el-container>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      // 头部导航栏
      activeIndex: '1',
      // 折叠菜单
      isCollapse: false,
      isSelect: false,
      a: '',
      b: '',
      circleUrl: '../../static/image/001.png',
      size: 80,
      userName: 'admin'
    };
  },
  mounted() {
    // if(this.$route.path=='/home/Index'){
    //     this.$refs.btnn.style.position='relative';
    //     this.$refs.btnn.style.top='-20px';
    // }

    //
  },
  methods: {
    btnn(){
        this.$router.push({path:'/'});
    },
    // 头部导航栏
    handleSelect(key, keyPath) {
      console.log(key, keyPath);
    },
    shouye() {
      this.$router.push({ path: '/home/Index' }).catch(r => r);
    },
    // 侧边栏菜单 （也是折叠菜单）
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
      this.isSelect = true;
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
    chooseComponents(index) {}
  }
};
</script>
<style scoped>
.img-text {
  margin-top: 10px;
  font-weight: bold;
  color: white;
}
.user-img {
  margin-top: 5px;
}
.title {
  width: 100%;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 25px;
  margin-left: -10px;
  font-weight: bold;
  color: white;
}
.logo {
  font-size: 30px;
  flex: 0.2;
}
/* 头部 */
.el-header {
  /* background-color: #b3c0d1; */
  background-color: white;
  height: 50px;
  color: white;
  text-align: center;
  line-height: 60px;
  border: 1px solid gainsboro;
}
/* 侧边栏 */
.el-aside {
  background-color: #494b4c;
  /* opacity: 0.7; */
  /* background-color: #34aca2; */
  color: white;
  text-align: center;
  border: none;
  /* line-height: 200px; */
  /* height: 900px; */
}
/* 折叠菜单 */
.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 99.5%;
  min-height: 800px;
}

.el-submenu >>> .el-submenu__title {
  font-size: 18px;
  text-align: left;
  margin-top: 10px;
  margin-left: 5px;
  color: #f0f2f4;
}
/* .el-submenu  >>> .el-submenu__title {
  color: #39b9ae;
  border-left: 2px solid #39b9ae;
} */
.el-submenu >>> .el-submenu__title:hover {
  background-color: #494b4c !important;
}
.el-menu-item:hover {
  background-color: #494b4c !important;
}
.el-submenu >>> .el-icon-first-aid-kit {
  font-size: 20px;
}
.el-menu-item-group >>> .el-menu-item {
  text-align: left;
  font-size: 16px;
  margin-left: 20px;
  height: 35px;
  line-height: 35px;
  margin-bottom: 15px;
  color: #f0f2f4;
}
.el-menu-item-group >>> .is-active {
  border-left: 2px solid #2c8bed;
}

/* 内容 */
.el-main {
  /* background-color: #eff2f5; */
  background-color: rgb(246, 247, 253);
  color: #333;
}

body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}
.el-menu.el-menu--horizontal {
  border: none;
}
.top-menu .el-header .el-menu {
  height: 52px;
}
.top-menu .el-menu .is-active {
  height: 53px;
}
.top-menu .el-menu .el-menu-item {
  height: 52px;
}
.top-menu{
  position: relative;
  left: 0px;
  top: 20px;
  width: 250px;
  /* height: 60px; */

  /* background-color: cornflowerblue; */
}
/* 侧边栏和内容的布局 */
/* .el-container{
height: 550px;
  } */
 
  .btnn{
 
    position: relative;
    left: 530px;
    top: -20px;
    /* padding: 0px 0px 0px 800px ; */
    font-weight: bolder;
    color: rgb(85, 206, 206);
  }
  .el-bread{
    /* width: 40px;
    height: 20px; */
    position: relative;
    left: 0px;
    top: 20px;
  }

</style>
